package com.springboot.web;

import com.springboot.model.Student;
import com.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SudentController {
    @Autowired
    private StudentService studentService;

    @RequestMapping(value = "/student")

    public @ResponseBody Student queryStudentId(Integer id){

        //调用业务层的方法
        Student student =studentService.queryStudentId(id );
        return student;
    }
}
